import os
from langchain_openai import ChatOpenAI

# 走代理，
os.environ['http_proxy'] = "127.0.0.1:7897"
os.environ['https_proxy'] = "127.0.0.1:7897"

os.environ['LANGCHAIN_TRACING_V2'] = "true"
#os.environ['LANGCHAIN_ENDPOINT'] = "https://api.smith.langchain.com"
os.environ['LANGCHAIN_API_KEY'] = "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"
#os.environ['LANGCHAIN_PROJECT'] = "pr-stupendous-culture-88"
# 设置 OpenAI API 密钥
os.environ['OPENAI_API_KEY'] = "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"
llm = ChatOpenAI(model="gpt-3.5-turbo")
out = llm.invoke("四川有多少个城市？")
print(out.content)
